package com.dian.api.inv;


import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import com.dian.api.inv.param.GoodsQtyParam;
import com.dian.api.inv.result.GoodsQtyResult;
import com.dian.api.inv.result.GoodsQtyResultVO;
import com.dian.common.utils.BeanConverter;
import com.dian.common.utils.PageUtils;
import com.dian.modules.base.service.GoodsService;
import com.dian.modules.inv.service.GoodsStockService;
import com.gitee.easyopen.annotation.Api;
import com.gitee.easyopen.annotation.ApiService;
import com.gitee.easyopen.doc.annotation.ApiDoc;
import com.gitee.easyopen.doc.annotation.ApiDocMethod;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

import java.util.Map;

@ApiService
@ApiDoc(value = "业务API", order = 1)
public class GoodsQtyApi {

    @Autowired
    public GoodsStockService goodsStockService;

    @Api(name = "inv.qty.list")
    @ApiDocMethod(description="实时库存查询",resultClass= GoodsQtyResultVO.class)
    PageUtils<GoodsQtyResult> queryQtyList(GoodsQtyParam param) {
        Map<String, Object> params=BeanUtil.beanToMap(param);
       return BeanConverter.convertPage(goodsStockService.queryPage(params),GoodsQtyResult.class);
    }
}

